Launching and managing unattended application programs

ABSTRACT

Provided are techniques for launching and managing an unattended application program. The application program is launched in background mode. In response to determining that an exit command has been received, an exit command indicator is set to indicate that the exit command has been received and a notification is sent to wake up a blocked main thread of the launched application program.

FIELD

Embodiments of the invention relate to launching and managing unattendedapplication programs, such as content management application programs.

BACKGROUND

Custom content management application programs may be described asstoring and managing various types of digitized content, such asdocument images, electronic office documents, eXtensible Markup Language(XML) documents, audio, and video that are related to a businessprocesses of a commercial organization or an institution. The contentmanagement application programs may be short-running applicationprograms or long-running application programs. Conventional systemsimplement custom content management application programs as a Windows®service or a UNIX® daemon. (Windows is a registered trademark ofMicrosoft Corporation in the United States and/or other countries. UNIXis a registered trademark of The Open Group in the United States and/orother countries.) However, with such implementations, on-demandexecution in background mode is required, and execution at boot time isnot suitable. Also, with such implementations, additional C programmingmay be needed for writing a Windows® service or a UNIX® daemon.

Furthermore, typical background mode processing in UNIX® commands (e.g.,“&” and “nohup”) terminate the background process after the user logsoff from the foreground console session.

SUMMARY

Provided is a method for launching and managing an unattendedapplication program. The application program is launched in backgroundmode. In response to determining that an exit command has been received,an exit command indicator is set to indicate that the exit command hasbeen received and a notification is sent to wake up a blocked mainthread of the launched application program.

Provided is a computer program product for launching and managing anunattended application program. The computer program product comprises acomputer readable storage medium having program code embodied therewith,the program code executable by at least one processor to perform:launching an application program in background mode; and, in response todetermining that an exit command has been received, setting an exitcommand indicator to indicate that the exit command has been received;and sending a notification to wake up a blocked main thread of thelaunched application program.

Provided is a computer system for launching and managing an unattendedapplication program. The computer system comprises one or moreprocessors, one or more computer-readable memories and one or morecomputer-readable, tangible storage devices; and program instructions,stored on at least one of the one or more computer-readable, tangiblestorage devices for execution by at least one of the one or moreprocessors via at least one of the one or more memories, to performoperations, the operations comprising: launching an application programin background mode; and, in response to determining that an exit commandhas been received, setting an exit command indicator to indicate thatthe exit command has been received; and sending a notification to wakeup a blocked main thread of the launched application program.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

In the drawings, like reference numbers represent corresponding partsthroughout.

FIG. 1 illustrates, in a block diagram, a computing environment inaccordance with certain embodiments.

FIG. 2 illustrates, in a block diagram, an application program inaccordance with certain embodiments.

FIG. 3 illustrates an overview of foreground mode and background modeprocessing in accordance with certain embodiments.

FIG. 4 illustrates, in a flow diagram, operations for using utilities inaccordance with certain embodiments.

FIGS. 5A and 5B illustrate, in a flow diagram, operations for checking aterminate indicator and setting an exit command indicator in accordancewith certain embodiments.

FIG. 6 illustrates, in a flow diagram, operations performed by ablocking mechanism in accordance with certain embodiments.

FIG. 7 illustrates, in a block diagram, a computer architecture that maybe used in accordance with certain embodiments.

DETAILED DESCRIPTION

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

FIG. 1 illustrates, in a block diagram, a computing environment inaccordance with certain embodiments. A computing device 100 includes alaunch controller 110, a launch monitor 120, an exit controller 130, andone or more application programs 140. The computing device 100 iscoupled to a data store 150. The data store 150 stores identifyinginformation and status information 160 for each of the one or moreapplication programs 140. In certain embodiments the status informationincludes a terminate indicator 162 for each launched application program140.

In certain embodiments, the terminate indicator 162 (e.g., a flag or abit) is set to true to indicate that the exit command has been receivedand that the launched application program is to be terminated or set tofalse to indicate that the exit command has not been received and thatthe launched application program is not to be terminated. In certainembodiments, in response to a user issuing an exit command to terminatea launched application program, the exit controller 130 sets theterminate indicator 162 for the launched application program to true toindicate that the exit command has been received.

In certain embodiments, the one or more application programs 140 includeat least one custom content management application program. In certainembodiments, the one or more application programs 140 include at leastone Java® application program. (Java is a registered trademark of OracleCorporation in the United States and/or other countries). In certainembodiments, the data store 150 is a persistent data store. A persistentdata store may be described as a storage that saves the data inpersistence. In certain embodiments, Java® Preferences ApplicationProgramming Interface (API)is utilized as the persistent data store. TheJava® Preferences API saves the data in a Windows® registry on Windows®platforms and saves the data in the user directory on UNIX® platforms.

Embodiments provide a way to run application programs (e.g., customcontent management application programs) in the background mode(unattended mode).

Running the application programs in the background mode may be describedas running without human attention. Furthermore, the application programcontinues to run in background mode even when the login user is loggedoff from a terminal session on a UNIX® platform or the user exits from acommand console on a Windows® platform. On the contrary, in foregroundmode, the application program will be terminated after the login user islogged off from a terminal session on a UNIX® platform or the user exitsfrom a command console on a Windows® platform.

Embodiments provide a technique for managing unattended applicationprograms. Embodiments allow unattended application programs to belaunched and managed in background mode. Embodiments provide:

-   -   (1) an enablement kit that enables the unattended background        processing of an application program; and    -   (2) a set of utility tools which manage the launch, termination        and status tracking of application programs in background mode.

FIG. 2 illustrates, in a block diagram, an application program 140 inaccordance with certain embodiments. The application program 140includes an exit command indicator 200, which is a global variable. Theexit command indicator 200 may be accessed by the checking mechanism 210and by the blocking mechanism 230. In certain embodiments, the exitcommand indicator 200 is set to true to indicate that an exit commandhas been received and set to false to indicate that an exit command hasnot been received

To enable the unattended mode, the application program 140 incorporatesthe checking mechanism 210 before the original application program logic220 and incorporates the blocking mechanism 230 after the originalapplication program logic 220. This avoids the need for additional Cprogramming and shell scripting. In certain embodiments, this is a Java®implementation that also enhances the portability with various platformsand maintainability of the application program. In certain embodiments,even though blocks 210, 220, and 230 may be invoked sequentially in theapplication program, they will run as separate execution threads afterthey are started.

The enablement kit includes an implementation (e.g., a Java®implementation) of the following elements:

-   -   The checking mechanism 210 for checking a terminate indicator        162 stored in the data store 150 to determine whether an exit        command has been received by the exit controller 130. Once the        exit command has been received, the checking mechanism 210 sets        an exit command indicator 200 (e.g., a flag or a bit) to        indicate the receipt of the exit command. Then, a notification        is sent to wake up a blocked main thread of a launched        application program.    -   The blocking mechanism 230 for blocking a main thread of a        launched application program if the exit command indicator 200        is set to indicate that an exit command has not been received.        When a notification is received to wake up the thread, the        blocking mechanism 230 terminates the launched application        program if the exit command indicator 200 is set to indicate        that an exit command has been received.    -   The data store 150 for storing the identifier information (e.g.,        a process Identifier (ID)) of each launched application program        and additional status information.

In certain embodiments, the launched application program is a mainthread, the checking mechanism 210 is a sub-thread of the main thread,the original application program logic 220 is another sub-thread of themain thread, and the blocking mechanism 230 as a routine of the mainthread of the original application program logic 220.

The following utility tools support the launch, termination, and statuschecking of the application programs running in background mode:

-   -   Launch controller 110 is a utility that launches an application        program (which incorporates the checking mechanism 210 and the        blocking mechanism 230).

After the application program is launched, the application program runsin background mode.

-   -   Launch monitor 120 is a utility that provides status tracking        capability by displaying in a Graphical User Interface (GUI) the        process IDs of launched application programs and possibly        additional information. such as user ID of a user who launched        the application program, a start time of when the application        program was launched, etc.    -   Exit controller 130 is a utility that terminates the application        program that is launched through the launch controller 110.

FIG. 3 illustrates an overview of foreground and background processingin accordance with certain embodiments. In FIG. 3, the launch controller110, the launch monitor 120, and the exit controller 130 run in theforeground, while the application programs A, B, and C 140 run in thebackground.

In FIG. 3, from the launch controller 110, a user may launch applicationprograms A, B, and C 140, which run in background mode. In variousembodiments, a user may be a human user, a computer program, a device,etc. Application programs A, B, and C 140 store the process ID andadditional status in the data store 150. Application programs A, B, andC 140 may also retrieve the process ID and additional status from thedata store 150. Even when the user logs off from the current consolesession, the application programs A, B, and C 140 continue to run inbackground mode.

From the exit controller 130, the user may terminate a specificapplication program 140 that is running in background mode. The exitcontroller 130 updates the terminate indicator 162 for the terminatedapplication program 140 in the data store 150. In this manner, an exitcommand is sent to the data store 150 for the terminated applicationprogram. When the application program detects the arrival of an exitcommand in the data store 150 (via the checking mechanism 210), theapplication program will exit from the execution (i.e., terminate). Inaddition, the launch monitor 120 may be used to update and retrieve thestatus of launched application programs.

FIG. 4 illustrates, in a flow diagram, operations for using theutilities in accordance with certain embodiments. Control beings atblock 400 with, in response to receiving a request to launch anapplication program, the application program being launched using alaunch controller 110. In block 402, in response to a request toretrieve status or update status being received, providing or updating astatus of the launched application program using a launch monitor 120.In block 404, in response to a termination request being received,terminating the launched application program using an exit controller130.

FIGS. 5A and 5B illustrate, in a flow diagram, operations for checking aterminate indicator and setting an exit command indicator in accordancewith certain embodiments. Control begins at block 500 with the exitcontroller 130, in response to an application program 140 being launchedin background mode, setting a terminate indicator 162 to indicate thatan exit command has not been received (e.g., setting the terminateindicator 162 to false). In block 502, the checking mechanism 210 checksthe terminate indicator 162 in the data store 150. In block 504, thechecking mechanism 210 determines whether the terminate indicatorindicates that an exit command has been received. If so, processingcontinues to block 508 (FIG. 5B), otherwise, processing continues toblock 506.

In block 506, the checking mechanism 210 sleeps for a period of time(e.g., set by the user launching the application program or set by asystem administrator). When the checking mechanism 210 wakes up,processing continues to block 502.

In block 508, the checking mechanism 210 sets the exit command indicator200 in the launched application program to indicate that the exitcommand has been received for the launched application program (e.g.,sets the exit command indicator 200 to true). In block 510, the checkingmechanism 210 sends a notification to the blocking mechanism 230 to wakeup a blocked main thread of the launched application program.

FIG. 6 illustrates, in a flow diagram, operations performed by theblocking mechanism 230 in accordance with certain embodiments. Controlbegins at block 600 with the blocking mechanism 230 receiving anotification from the checking mechanism 210 to wake up a blocked mainthread of a launched application program. In block 602, the blockingmechanism 230 determines whether the exit command indicator 200 is setto indicate that an exit command has been received for the launchedapplication program (e.g., whether the exit command indicator 200 is setto true). In block 604, the blocking mechanism terminates the launchedapplication program. In block 606, the blocking mechanism blocks themain thread of the launched application program to prevent the launchedapplication program from terminating. In certain embodiments, the waitand notify features in Java® threading are used to handle the blockingand notification in a Java® thread.

Thus, with embodiments, long-running application programs may belaunched in background mode and will run until actively terminated.Also, on-demand execution is available as the application program may belaunched in background mode and terminated at any time by a user.

In order to address the requirement for unattended content managementapplication programs, embodiments enable the launch and management ofunattended content management application programs in background mode.

Thus, embodiments provide a new type of background processing to beaddressed which is different from the traditional ways of handlingbackground processing in Unix® platforms and Windows® platforms.

Embodiments provide a new approach supporting on-demand execution of anapplication program in the background (i.e., an unattended mode) withoutthe complexity and overhead of additional programming or shellscripting.

Additional Embodiment Details

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflow diagram (e.g., flowchart) illustrations and/or block diagrams ofmethods, apparatus (systems) and computer program products according toembodiments of the invention. It will be understood that each block ofthe flowchart illustrations and/or block diagrams, and combinations ofblocks in the flowchart illustrations and/or block diagrams, can beimplemented by computer program instructions. These computer programinstructions may be provided to a processor of a general purposecomputer, special purpose computer, or other programmable dataprocessing apparatus to produce a machine, such that the instructions,which execute via the processor of the computer or other programmabledata processing apparatus, create means for implementing thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The flowcharts and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowcharts or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowcharts illustration,and combinations of blocks in the block diagrams and/or flowchartsillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

In addition, the illustrated operations of the flow diagrams and blockdiagrams show certain events occurring in a certain order. Inalternative embodiments, certain operations may be performed in adifferent order, modified or removed. Moreover, operations may be addedto the above described logic and still conform to the describedembodiments. Further, operations described herein may occur sequentiallyor certain operations may be processed in parallel. Yet further,operations may be performed by a single processing unit or bydistributed processing units.

The code implementing the described operations may further beimplemented in hardware logic or circuitry (e.g., an integrated circuitchip, Programmable Gate Array (PGA), Application Specific IntegratedCircuit (ASIC), etc. The hardware logic may be coupled to a processor toperform operations.

Devices that are in communication with each other need not be incontinuous communication with each other, unless expressly specifiedotherwise. In addition, devices that are in communication with eachother may communicate directly or indirectly through one or moreintermediaries.

A description of an embodiment with several components in communicationwith each other does not imply that all such components are required. Onthe contrary a variety of optional components are described toillustrate the wide variety of possible embodiments of the presentinvention.

Further, although process steps, method steps, algorithms or the likemay be described in a sequential order, such processes, methods andalgorithms may be configured to work in alternate orders. In otherwords, any sequence or order of steps that may be described does notnecessarily indicate a requirement that the steps be performed in thatorder. The steps of processes described herein may be performed in anyorder practical. Further, some steps may be performed simultaneously.

When a single device or article is described herein, it will be readilyapparent that more than one device/article (whether or not theycooperate) may be used in place of a single device/article. Similarly,where more than one device or article is described herein (whether ornot they cooperate), it will be readily apparent that a singledevice/article may be used in place of the more than one device orarticle or a different number of devices/articles may be used instead ofthe shown number of devices or programs. The functionality and/or thefeatures of a device may be alternatively embodied by one or more otherdevices which are not explicitly described as having suchfunctionality/features. Thus, other embodiments of the present inventionneed not include the device itself.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof

The terms “an embodiment”, “embodiment”, “embodiments”, “theembodiment”, “the embodiments”, “one or more embodiments”, “someembodiments”, and “one embodiment” mean “one or more (but not all)embodiments of the present invention(s)” unless expressly specifiedotherwise.

The terms “including”, “comprising”, “having” and variations thereofmean “including but not limited to”, unless expressly specifiedotherwise.

The enumerated listing of items does not imply that any or all of theitems are mutually exclusive, unless expressly specified otherwise.

The corresponding structures, materials, acts, and equivalents of allmeans or step plus function elements in the claims below are intended toinclude any structure, material, or act for performing the function incombination with other claimed elements as specifically claimed. Thedescription of embodiments of the present invention has been presentedfor purposes of illustration and description, but is not intended to beexhaustive or limited to the invention in the form disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the invention.The embodiments were chosen and described in order to best explain theprinciples of the invention and the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

FIG. 7 illustrates a computer architecture 700 that may be used inaccordance with certain embodiments. In certain embodiments, computingdevice 100 may implement computer architecture 700. The computerarchitecture 700 is suitable for storing and/or executing program codeand includes at least one processor 702 coupled directly or indirectlyto memory elements 704 through a system bus 720. The memory elements 704may include local memory employed during actual execution of the programcode, bulk storage, and cache memories which provide temporary storageof at least some program code in order to reduce the number of timescode must be retrieved from bulk storage during execution. The memoryelements 704 include an operating system 705 and one or more computerprograms 706.

Input/Output (I/O) devices 712, 714 (including but not limited tokeyboards, displays, pointing devices, etc.) may be coupled to thesystem either directly or through intervening I/O controllers 710.

Network adapters 708 may also be coupled to the system to enable thedata processing system to become coupled to other data processingsystems or remote printers or storage devices through interveningprivate or public networks. Modems, cable modem and Ethernet cards arejust a few of the currently available types of network adapters 708.

The computer architecture 700 may be coupled to storage 716 (e.g., anytype of storage device; a non-volatile storage area, such as magneticdisk drives, optical disk drives, a tape drive, etc.). The storage 716may comprise an internal storage device or an attached or networkaccessible storage. Computer programs 706 in storage 716 may be loadedinto the memory elements 704 and executed by a processor 702 in a mannerknown in the art.

The computer architecture 700 may include fewer components thanillustrated, additional components not illustrated herein, or somecombination of the components illustrated and additional components. Thecomputer architecture 700 may comprise any computing device known in theart, such as a mainframe, server, personal computer, workstation,laptop, handheld computer, telephony device, network appliance,virtualization device, storage controller, etc.

The foregoing description of embodiments of the invention has beenpresented for the purposes of illustration and description. It is notintended to be exhaustive or to limit the embodiments to the preciseform disclosed. Many modifications and variations are possible in lightof the above teaching. It is intended that the scope of the embodimentsbe limited not by this detailed description, but rather by the claimsappended hereto. The above specification, examples and data provide acomplete description of the manufacture and use of the composition ofthe embodiments. Since many embodiments may be made without departingfrom the spirit and scope of the invention, the embodiments reside inthe claims hereinafter appended or any subsequently-filed claims, andtheir equivalents.

1. A method, comprising: launching, using a processor of a computer, anapplication program in background mode; in response to determining thatan exit command has been received, setting an exit command indicator toindicate that the exit command has been received; and sending anotification to wake up a blocked main thread of the launchedapplication program.
 2. The method of claim 1, wherein the launchedapplication program includes a checking mechanism and a blockingmechanism.
 3. The method of claim 2, wherein the setting of the exitcommand indicator and the sending of the notification are performed bythe checking mechanism.
 4. The method of claim 2, wherein the blockingmechanism receives the notification and, in response to determining thatthe exit command has been received, wakes up the blocked main thread ofthe launched application program to allow the launched applicationprogram to terminate.
 5. The method of claim 2, wherein, the blockingmechanism receives the notification and, in response to determining thatthe exit command has not been received, blocks the main thread of thelaunched application program to prevent the launched application programfrom terminating.
 6. The method of claim 2, wherein the checkingmechanism checks a terminate indicator to determine whether the exitcommand has been received.
 7. The method of claim 1, wherein theapplication program is launched and terminated on-demand. 8-20.(canceled)